<?=View::factory('admin/common/header')?>
<div id="content">
  <div class="breadcrumb">
    <a href="<?=URL::site('admin')?>">管理首页</a>
    &raquo; 权限列表
  </div>
  <?=View::factory('admin/common/message')?>
  <div class="box">
    <div class="heading">
      <h1><img src="<?=URL::site()?>images/admin/user-group.png" alt="" /> 权限列表</h1>
      <div class="buttons">
        <input type="button" onclick="location='<?=URL::site('admin/manager_privilege/add')?>';" class="btn45" value="添加" />
      </div>
    </div>
    <div class="content">
    <table class="list">
      <thead>
        <tr>
          <td class="center autosort" name="priv.priv_id">ID</td>
          <td class="left autosort" name="res.res_name">资源</td>
          <td class="left autosort" name="priv.priv_name">权限</td>
          <td class="left autosort" name="priv.token">标识</td>
          <td class="center autosort" name="priv.sort_order">排序</td>
          <td class="right">操作</td>
        </tr>
      </thead>
      <tbody>
        <tr class="filter">
          <td class="center">&nbsp;</td>
          <td class="left"><select name="res_id">
            <option value="0"></option>
          <? foreach ($resources as $resource) { ?><option value="<?=$resource['res_id']?>" <?=$resource['res_id']==$res_id?'selected':''?>><?=$resource['res_name']?></option><? } ?>
          </select></td>
          <td class="left"><input type="text" name="priv_name" size="20" value="<?=$priv_name?>" /></td>
          <td class="left"><input type="text" name="token" size="20" value="<?=$token?>" /></td>
          <td class="center">&nbsp;</td>
          <td class="right">[ <a onclick="$.filter_clean();">清除</a> ] <input type="button" onclick="$.filter_submit();" class="btn45" value="筛选" /></td>
        </tr>
        <? foreach ($pagination as $privilege) { ?>
        <tr>
          <td class="center"><?=$privilege['priv_id']?></td>
          <td class="left"><?=$privilege['res_name']?></td>
          <td class="left"><?=Str::highlight($privilege['priv_name'], $priv_name)?></td>
          <td class="left"><?=Str::highlight($privilege['token'], $token)?></td>
          <td class="center"><?=$privilege['sort_order']?></td>
          <td class="right">
            [ <a href="<?=URL::site('admin/manager_privilege/edit/'.$privilege['priv_id'])?>">编辑</a> ]
            [ <a href="javascript: $.ajax_get({url:'<?=URL::site('admin/manager_privilege/del/'.$privilege['priv_id'])?>'}); void(0);" class="delete">删除</a> ]</td>
        </tr>
        <? } ?>
      </tbody>
    </table>
    <?=$pagination?>
    </div>
  </div>
</div>
<?=View::factory('admin/common/footer')?>
<script type="text/javascript">
$().ready(function(){
    $('#system').addClass('selected');
});
</script>